<!-- 普通用户 -->
<template>
  <ul class="menuList">
    <!-- <li style="    height: 0.68rem;
    display: flex;">
      <router-link to='/authentication' style="width: 1.74rem;
      height: 0.68rem;">
        <img src="../../image/auth.png" width="100%" height="100%" alt="">
      </router-link>
      <router-link to='/clinicAddress' style="width: 1.74rem;
      height: 0.68rem;">
        <img src="../../image/clinic.png" width="100%" height="100%" alt="">
      </router-link>
    </li> -->


  
    <li>
      <router-link to="/orderManagement">
        <img src="../../image/icon_studio_backstage.png" width="30" height="30" alt="">
        <h3>团购订单</h3>
        <span></span>
      </router-link>
    </li>
    <li>
      <router-link to='/myCollect'>
        <img src="../../image/icon_studio_my.png" width="30" height="30" alt="">
        <h3>视频收藏</h3>
        <span></span>
      </router-link>
    </li>
    <li>
      <router-link to="/myNews">
        <img src="../../image/icon_news_my.png" width="30" height="30" alt="">
        <h3>我的消息</h3>
        <span></span>
      </router-link>
    </li>
    <li>
      <a @click='goMyLiveRoom'>
        <img src="../../image/icon_studio1_my.png" width="30" height="30" alt="">
        <h3>我的直播间</h3>
        <span></span>
      </a>
    </li>



    <li>
      <router-link to="/Coupon">
        <img src="../../image/icon_order_management.png" width="30" height="30" alt="">
        <h3>我的优惠券</h3>
        <span></span>
      </router-link>
    </li>


    <!-- <li>
      <router-link to="/shoppingcart">
        <img src="../../image/icon_order_management.png" width="30" height="30" alt="">
        <h3>我的购物车</h3>
        <span></span>
      </router-link>
    </li> -->

    <li class="noBorder">
      <router-link to="/setting">
        <img src="../../image/icon_setting.png" width="30" height="30" alt="">
        <h3>设置</h3>
        <span></span>
      </router-link>
    </li>
  </ul>
</template>
<script>
  export default {
    data() {
      return {
        userid: '',
        usertype: "", // 判断用户是否通过医师认证 如果通过就是doctor
        live_type: '',
      }
    },
    methods: {
      justUserType() { //判断用户是否通过医生认证
        this.userid = localStorage.getItem("loginMobile");
        if (this.userid) {
          this.$api.get(this.$api.baseURLSchool, "select_cid/user/" + this.userid, {}, r => {
            if (r.data.ret == 1) {
              if (r.data.info.per_app_status == "1") {
                this.usertype = "doctor";
              }
              if (r.data.info.live_status == "1") {
                this.live_type = "live";
              }
            }

          }, err => {
            console.log(err);
          })
        }

      },
      //创建直播课程 判断如果认证过了就可以创建 否则去认证页面
      goUploadVdo() {
        //判断用户是否认证 如果认证审核通过
        if (this.usertype == 'doctor') {
          this.$router.push({
            name: 'uploadFile'
          });
        } else {
          this.$router.push({
            name: 'authentication'
          });
        }
      },
      // 我的诊室
      goMyClinic() {
        //判断用户是否认证 如果认证审核通过
        if (this.usertype == 'doctor') {
          this.$router.push({
            name: 'myClinic'
          });
        } else {
          this.$router.push({
            name: 'authentication'
          });
        }
      },
      // 我的直播间
      goMyLiveRoom() {
        //判断用户是否认证 如果认证审核通过
        if (this.live_type == 'live') {
          this.$router.push({
            name: 'myLiveRoom'
          });
        } else {
          this.$router.push({
            name: 'authentication'
          });
        }
      }
    },
    created() {
      this.justUserType();
    }
  }

</script>
<style lang="scss" scoped>
  .menuList li:nth-last-of-type(-n+6) {
    background: url('../../image/libac.png');
    background-size: 100%;
  }

  .menuList li:nth-last-of-type(-n+6) img {
    margin-left: 0.15rem !important;
  }

</style>
